<template>
  <header class="header">
    <h1>todos</h1>
    <input
      class="new-todo"
      placeholder="请输入任务名称"
      autofocus
      v-model="uname"
      @keyup.enter="addList"
    />
  </header>
</template>

<script>
export default {
  name: 'Header',
  props: {},
  components: {},
  data () {
    return {
      uname: ''
    }
  },
  methods: {
    addList () {
      this.$emit('addList', this.uname)
      // console.log(this.uname);
      this.uname = ''
    }
  },
  watch: {},
  computed: {},
  filters: {}
}
</script>

<style scoped lang="less"></style>
